<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionController::TestCase</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionController::TestCase</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_controller/test_case_rb.html">
                vendor/rails/actionpack/lib/action_controller/test_case.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../ActiveSupport/TestCase.html">
                ActiveSupport::TestCase
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000374">controller_class</a>&nbsp;&nbsp;
      <a href="#M000373">controller_class=</a>&nbsp;&nbsp;
      <a href="#M000375">determine_default_controller_class</a>&nbsp;&nbsp;
      <a href="#M000376">prepare_controller_class</a>&nbsp;&nbsp;
      <a href="#M000377">rescue_action</a>&nbsp;&nbsp;
      <a href="#M000378">setup</a>&nbsp;&nbsp;
      <a href="#M000372">tests</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000374" class="method-detail">
        <a name="M000374"></a>

        <div class="method-heading">
          <a href="#M000374" class="method-signature">
          <span class="method-name">controller_class</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000374-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000374-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 24</span>
24:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">controller_class</span>
25:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current_controller_class</span> = <span class="ruby-identifier">read_inheritable_attribute</span>(<span class="ruby-identifier">:controller_class</span>)
26:           <span class="ruby-identifier">current_controller_class</span>
27:         <span class="ruby-keyword kw">else</span>
28:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">controller_class</span>= <span class="ruby-identifier">determine_default_controller_class</span>(<span class="ruby-identifier">name</span>)
29:         <span class="ruby-keyword kw">end</span>
30:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000373" class="method-detail">
        <a name="M000373"></a>

        <div class="method-heading">
          <a href="#M000373" class="method-signature">
          <span class="method-name">controller_class=</span><span class="method-args">(new_class)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000373-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000373-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 19</span>
19:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">controller_class=</span>(<span class="ruby-identifier">new_class</span>)
20:         <span class="ruby-identifier">prepare_controller_class</span>(<span class="ruby-identifier">new_class</span>)
21:         <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:controller_class</span>, <span class="ruby-identifier">new_class</span>)
22:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000375" class="method-detail">
        <a name="M000375"></a>

        <div class="method-heading">
          <a href="#M000375" class="method-signature">
          <span class="method-name">determine_default_controller_class</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000375-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000375-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 32</span>
32:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">determine_default_controller_class</span>(<span class="ruby-identifier">name</span>)
33:         <span class="ruby-identifier">name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/Test$/</span>, <span class="ruby-value str">''</span>).<span class="ruby-identifier">constantize</span>
34:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span>
35:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">NonInferrableControllerError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)
36:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000376" class="method-detail">
        <a name="M000376"></a>

        <div class="method-heading">
          <a href="#M000376" class="method-signature">
          <span class="method-name">prepare_controller_class</span><span class="method-args">(new_class)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000376-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000376-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 38</span>
38:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepare_controller_class</span>(<span class="ruby-identifier">new_class</span>)
39:         <span class="ruby-identifier">new_class</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
40:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rescue_action</span>(<span class="ruby-identifier">e</span>)
41:             <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
42:           <span class="ruby-keyword kw">end</span>
43:         <span class="ruby-keyword kw">end</span>
44:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000377" class="method-detail">
        <a name="M000377"></a>

        <div class="method-heading">
          <a href="#M000377" class="method-signature">
          <span class="method-name">rescue_action</span><span class="method-args">(e)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000377-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000377-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 40</span>
40:           <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rescue_action</span>(<span class="ruby-identifier">e</span>)
41:             <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
42:           <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000372" class="method-detail">
        <a name="M000372"></a>

        <div class="method-heading">
          <a href="#M000372" class="method-signature">
          <span class="method-name">tests</span><span class="method-args">(controller_class)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000372-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000372-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 15</span>
15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tests</span>(<span class="ruby-identifier">controller_class</span>)
16:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">controller_class</span> = <span class="ruby-identifier">controller_class</span>
17:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000378" class="method-detail">
        <a name="M000378"></a>

        <div class="method-heading">
          <a href="#M000378" class="method-signature">
          <span class="method-name">setup</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000378-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000378-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_case.rb, line 47</span>
47:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
48:       <span class="ruby-ivar">@controller</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">controller_class</span>.<span class="ruby-identifier">new</span>
49:       <span class="ruby-ivar">@request</span>    = <span class="ruby-constant">TestRequest</span>.<span class="ruby-identifier">new</span>
50:       <span class="ruby-ivar">@response</span>   = <span class="ruby-constant">TestResponse</span>.<span class="ruby-identifier">new</span>
51:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>